package com.xbongbong.paas.manager.feign;

import com.xbongbong.paas.toolbox.wrap.BaseVO;
import com.xbongbong.paas.toolbox.wrap.XbbResponse;
import com.xbongbong.schedule.pojo.dto.ScheduleTaskAddBatchDTO;
import com.xbongbong.schedule.pojo.dto.ScheduleTaskAddDTO;
import com.xbongbong.schedule.pojo.dto.ScheduleTaskCancelDTO;
import com.xbongbong.schedule.pojo.vo.ScheduleTaskAddBatchVO;
import com.xbongbong.schedule.pojo.vo.ScheduleTaskAddVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "pro-web-schedule", contextId = "scheduleTaskFeignClient")
public interface ScheduleTaskFeignClient {

    @RequestMapping(value = "/pro/v1/schedule/task/add", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<ScheduleTaskAddVO> scheduleTaskAdd(@RequestBody ScheduleTaskAddDTO scheduleTaskAddDTO, @RequestParam("lang") String lang);

    @RequestMapping(value = "/pro/v1/schedule/task/addBatch", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<ScheduleTaskAddBatchVO> scheduleTaskAddBatch(@RequestBody ScheduleTaskAddBatchDTO scheduleTaskAddBatchDTO, @RequestParam("lang") String lang);

    @RequestMapping(value = "/pro/v1/schedule/task/cancel", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<BaseVO> scheduleTaskCancel(@RequestBody ScheduleTaskCancelDTO scheduleTaskCancelDTO, @RequestParam("lang") String lang);
}
